timedatectl
timedatectl is the standard Linux command to check and manage server time, timezone, and NTP synchronization.
Why this matters in server onboarding
Correct time is required for:
- SSL/TLS certificate validation
- cron jobs and scheduled tasks
- log analysis and incident timelines
- database replication and backup consistency
If server time is wrong, many systems fail in confusing ways.
Quick status checks
Show current time status
timedatectl status
Show machine-readable output
timedatectl show
Look for:
Time zoneSystem clock synchronizedNTP service
Set timezone correctly
List available timezones
timedatectl list-timezones
Set timezone (example: Jakarta)
sudo timedatectl set-timezone Asia/Jakarta
Verify
timedatectl status
Enable NTP synchronization
Enable NTP
sudo timedatectl set-ntp true
Disable NTP
sudo timedatectl set-ntp false
Verify sync state
timedatectl status
Expected healthy state:
NTP service: activeSystem clock synchronized: yes
Set time manually (only when needed)
Manual time setting should be temporary and used only for recovery or isolated systems.
sudo timedatectl set-time "2026-02-15 22:30:00"
After manual correction, re-enable NTP:
sudo timedatectl set-ntp true
RTC mode (hardware clock)
Use UTC for servers (recommended):
sudo timedatectl set-local-rtc 0
Use local time (generally not recommended on servers):
sudo timedatectl set-local-rtc 1
Troubleshooting checklist
- Confirm timezone is correct.
- Confirm NTP is enabled.
- Confirm
System clock synchronized: yes. - Check UDP/123 reachability if sync fails.
- Check which time service is running (
systemd-timesyncd,chronyd, orntpd).
Useful companion commands
date
timedatectl status
journalctl -u systemd-timesyncd --no-pager -n 50
Recommended onboarding baseline
- Set timezone to your operational region.
- Enable NTP immediately after first login.
- Keep RTC in UTC (
set-local-rtc 0). - Verify time settings before installing SSL, database, and backup jobs.